//调用接口配置文件
import { request } from 'config/request'

//获取礼品列表
export async function getGiftList(params) {
	return request({
		url: 'asset/present/add',
		method: 'POST',
		data: params
	});
};

//修改礼品详情
export async function editGiftDetail(params) {
	return request({
		url: 'asset/present/update',
		method: 'POST',
		data: params
	});
};

//获取礼品详情
// export async function getGiftDetail(params) {
// 	return request({
// 		url: ' asset/present/get',
// 		method: 'GET',
// 		data: params
// 	});
// };

// //获取区域数据
// export async function getRegion(params) {
// 	return request({
// 		url: 'admin/product/present/getRegion',
// 		method: 'GET',
// 		data: params
// 	});
// };

// //获取项目数据
// export async function getProject(params) {
// 	return request({
// 		url: `admin/product/present/getProject/${params.regionId}`,
// 		method: 'GET',
// 	});
// };

//新增礼物信息
export async function giftRegAdd(params) {
	return request({
		url: 'admin/product/present/add',
		method: 'POST',
		data: params
	});
};

//编辑礼物信息
export async function giftRegEdit(params) {
	return request({
		url: 'admin/product/present/update',
		method: 'POST',
		data: params
	});
};


//删除礼品信息
export async function giftDelete(params) {
	return request({
		url: `admin/product/present/delete/${params.id}`,
		method: 'GET',
		// data: params
	});
};


//获取礼品详情
export async function getGiftDetail(params) {
	return request({
		url: `admin/product/present/get/${params.giftId}`,
		method: 'GET',
	});
};

//获取用户信息
export async function getUserDetail(params){
    return request({
        url:'admin/permissionAdmin/detail',
        method:'POST',
        headers:{
            "Content-type":'application/json'
        },
        data:params
    })
}

//获取项目与区域数据
export async function queryUserRegion(params) {
	return request({
		url: `admin/product/present/queryUserRegion/${params.accountId}`,
		method: 'GET',
	});
};

